package net.huashitong.ssydt.provider.exam.mapper;


import net.huashitong.ssydt.exam.entity.SsExamPaperRecord;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface SsExamPaperRecordMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SsExamPaperRecord record);

    int insertSelective(SsExamPaperRecord record);

    SsExamPaperRecord selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SsExamPaperRecord record);

    int updateByPrimaryKey(SsExamPaperRecord record);

    SsExamPaperRecord getNotHistoryByUserIdAndPaperId(SsExamPaperRecord record);

    /**
     * 统计某个试卷的已交卷数
     *
     * @param paperId
     * @return
     */
    int countSubmittedByPaperId(Long paperId);

    /**
     * 统计某个试卷的小于等于的correctNumber已交卷数
     *
     * @param record
     * @return
     */
    int countSubmittedByPaperIdWithLessOrEqualsCorrectNumber(SsExamPaperRecord record);

}